package com.lxw.framework.exception;


import com.lxw.framework.model.response.ResultCode;

//自定义异常类
public class CustomException extends RuntimeException {

    //枚举类 异常
    private ResultCode resultCode;

    //构造异常信息
    public CustomException(ResultCode resultCode) {
        //异常信息为错误代码+异常信息
        super("错误代码："+resultCode.code()+"错误信息："+resultCode.message());
        this.resultCode = resultCode;
    }
    public ResultCode getResultCode(){
        return this.resultCode;
    }


}
